In conventional systems, the speed and efficiency of many computing applications depend in large part upon the availability of processing resources. To this end, conventional computer systems provide computing architectures that commonly incorporate multithreaded processes that enable the sharing of resources in order to accommodate multiple paths of execution within a computer/operating system. As such, a thread may be characterized as a separately executable portion of a process. Each thread typically has its own distinct program counter and represents a separate movement of a processor through program instruction space and storage. In this manner, a program may be broken-up into multiple different threads. Ideally, this segmentation avoids requiring a computer process to execute a single unitary process or program from start to finish with pronounced intervals of wasted processing time. As such, a thread continuously accesses a resource until either its execution is interrupted or that thread must wait for a resource it requires to become available.
To facilitate coordination of threads and associated resources, threads typically share a priority scheme or schedule that partially dictates allocation of processing cycles as between different threads. A task dispatcher program may use this scheme to assign and dispatch a central processing unit(s) (CPU), timeslice, or other resource to each thread. Such exemplary resources might include hardware registers, database files and other memory resources. Thus, multithreaded operation can provide the illusion of simultaneous execution of multiple programs, given the relatively high processing speeds relative to that of other resources in the computer.
As a consequence, when synchronizing multiple threads of control in conventional systems, often one thread owns a resource that another thread needs. When one thread finds that another thread owns such a resource, the thread can either “spin” to wait for the resource to be released, or “yield”, thereby giving up the processor and waiting to be notified when the resource is available.
Spinning is a technique in which a process repeatedly checks to see if a condition is true, such as waiting for keyboard input or waiting for a lock (i.e. a lock on a required resource) to become available. Spinning can also be used to delay execution for some amount of time; this was necessary on old computers that had no method of waiting a specific length of time other than by repeating a useless loop a specific number of times. Spinning can be a valid strategy in certain special circumstances, most notably in the implementation of spinlocks within conventional operating systems designed to run on SMP systems.